package kp.rpc.loadbalancer.factory;

import kp.rpc.loadbalancer.LoadBalancer;
import kp.rpc.loadbalancer.impl.RoundRobinLoadBalancer;
import kp.rpc.spi.SpiLoader;

public class LoadBalancerFactory {
    static {
        SpiLoader.load(LoadBalancer.class);
    }

    //默认的负载均衡器
    private static final LoadBalancer DEFAULT_LOAD_BALANCER = new RoundRobinLoadBalancer();

    public static LoadBalancer getLoadBalancer(String key) {
        return SpiLoader.getInstance(LoadBalancer.class, key);
    }
}
